<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        
        table {
            margin: 100px auto;
            text-align: center;
            width: 800px;
            border-collapse: collapse;
            font-size: 14px;
        }
        thead{
            background-color: skyblue;
        }
        thead tr  {
            height: 30px;            
        }
        tbody tr{
            height: 30px;
            border-bottom: 1px solid #ccc;
            cursor: pointer;
        }
        tbody td {
            border-bottom: 1px solid #d7d7d7;
            font-size: 12px;
            color: green;
        }
        .bgc {
            background-color: red;
        }
    </style>
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>名称</th>
                <th>代码</th>
                <th>最近公布净值</th>
                <th>累计净值</th>
                <th>前单位净值</th>
                <th>净值增长率</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>003562</td>
                <td>前海开源新能源公用事业</td>
                <td>1.126</td>
                <td>1.462</td>
                <td>1.469</td>
                <td>+0.0472%</td>
            </tr>
            <tr>
                <td>003562</td>
                <td>前海开源新能源公用事业</td>
                <td>1.126</td>
                <td>1.462</td>
                <td>1.469</td>
                <td>+0.0472%</td>
            </tr>
            <tr>
                <td>003562</td>
                <td>前海开源新能源公用事业</td>
                <td>1.126</td>
                <td>1.462</td>
                <td>1.469</td>
                <td>+0.0472%</td>
            </tr>
            <tr>
                <td>003562</td>
                <td>前海开源新能源公用事业</td>
                <td>1.126</td>
                <td>1.462</td>
                <td>1.469</td>
                <td>+0.0472%</td>
            </tr>
            <tr>
                <td>003562</td>
                <td>前海开源新能源公用事业</td>
                <td>1.126</td>
                <td>1.462</td>
                <td>1.469</td>
                <td>+0.0472%</td>
            </tr>
            <tr>
                <td>003562</td>
                <td>前海开源新能源公用事业</td>
                <td>1.126</td>
                <td>1.462</td>
                <td>1.469</td>
                <td>+0.0472%</td>
            </tr>
        </tbody>
    </table>
    <script>
        var trs = document.querySelector('tbody').querySelectorAll('tr');
        for (var i = 0;i < trs.length; i++) {
            trs[i].onmouseover = function() {
                this.className ='bgc';
            }
            trs[i].onmouseout = function () {
                this.className = '';
            }            
        }
    </script>
</body>
</html>